Time and date
get_time
Returns the current time, date, day of week, week number, and timezone name. This is useful for tasks that require knowledge of current time (for example, appointment scheduling) that LLM completely lacks. The tool has an optional timezone parameter that specifies the timezone in which the time is returned. If the parameter is omitted or set to local, the timezone is taken from the timezone variable; if that variable is not set either, UTC is used.
Note: In most cases, it is preferable to avoid the get_time tool and include time and date variables in your prompt instead; for example:
Current time and date is {current_datetime}`
Variables provide the same functionality without introducing the latency of an extra tool call. The get_time tool is mainly useful when the agent needs the exact current time at a specific point during the conversation, rather than the time captured when the conversation started.
Refer to Time and date variables for details.
Function specification
name: get_time
description: Get current time.
parameters:
- timezone
type: string
description: Timezone. If omitted or set to "local", the `timezone` variable is used; if that variable is not set either, UTC is used.
required: false
Response
The tool always returns a JSON object with the following keys:
| Key | Description |
|---|---|
time
|
Current time, formatted as HH:MM:SS. |
date
|
Current date, formatted as YYYY-MM-DD. |
day_of_week
|
Day of week name, for example Monday. |
week_number
|
Week number of the year (00–53). |
tzname
|
Name of the timezone the time is reported in, for example Europe/Paris. |
Sample prompt
Use `get_time` tool with `timezone` parameter set to
"Europe/Paris" to get the current time.
Alternatively, the timezone can be specified via the timezone variable:
Variables:
timezone = Europe/Paris
convert_time
Converts time from human format to ISO 8601 format. For example, the user may specify “tomorrow at 2 PM” and the tool will return “2025-01-16T14:00:00Z”. The tool has optional from_timezone and to_timezone parameters that specify source and destination timezones for the conversion. If not specified, UTC timezone is used.
Note: In most cases, it is preferable to avoid the convert_time tool and include the {calendar} variable in your prompt instead; for example:
Calendar information:
{calendar}
The presence of calendar information enables the LLM to resolve relative expressions like “tomorrow at 2 PM” into ISO 8601 timestamps itself.
Use the from_utc() and to_utc() functions in your tool parameter configuration to convert those timestamps between UTC and the timezone given by the timezone variable. This provides the same functionality without introducing the latency of an extra tool call.
Refer to Calendar variables and Time parameters conversion for details.
Function specification
name: convert_time
description: Convert date and time provided by user to date and time in ISO 8601 format.
parameters:
- usertime
type: string
description: Date and time provided by user, e.g. "tomorrow 10 am".
- next_year
type: boolean
description: Assume that future months are in next year.
default: true
- from_timezone
type: string
description: Timezone in which user provided the date and time.
default: UTC
- to_timezone
type: string
description: Timezone for the output date and time.
default: UTC
Sample prompt
Convert the provided time and date to UTC timezone using
`convert_time` tool with `from_timezone` parameter set
to "Europe/Paris".
convert_multiple_times
This is similar to convert_time, but it converts a list of string, specifying multiple times. This is useful, for example, for converting get_free_slots response from calendar APIs.
Note: As with convert_time, in most cases it is preferable to avoid the convert_multiple_times tool and include the {calendar} variable in your prompt instead; for example:
Calendar information:
{calendar}
The presence of calendar information enables the LLM to resolve relative expressions like “tomorrow at 2 PM” into ISO 8601 timestamps itself.
Use the from_utc() and to_utc() functions in your tool parameter configuration to convert those timestamps between UTC and the timezone given by the timezone variable. This provides the same functionality without introducing the latency of an extra tool call.
Refer to Calendar variables and Time parameters conversion for details.
Function specification
name: convert_multiple_times
description: Convert multiple times provided by user to times in ISO 8601 format.
parameters:
- usertimes
type: list of strings
description: Date and time provided by user, e.g. ["tomorrow 10 am"].
- next_year
type: boolean
description: Assume that future months are in next year.
default: true
- from_timezone
type: string
description: Timezone in which user provided the date and time.
default: UTC
- to_timezone
type: string
description: Timezone for the output date and time.
default: UTC
Sample prompt
Convert the received timeslots to local timezone using
`convert_multiple_times` tool with `to_timezone` parameter
set to "Europe/Paris".